Hello, I have a module with many requirement objects. The module has Requirement column with Yes or No values. Each requirement object has object text that has a sentence consisting of shall word. The object text, in addition to the sentence with shall, has additional information such as a note, rational/reason etc. Is there a simple dxl statement to extract requirement sentence portion from the object text and assign the extracted sentence to a variable such as requirement_sentence = extracted sentence,please. Thanks in advance and best regards, Mike
MikeMelon - Sun Sep 21 23:39:18 EDT 2014 |
Re: Sentence in Object Text You should be able to use Regular Expressions. I'm going to scribble something up but not try it. The problem is defining "Requirement Sentance". If your requirement statement is always the 1st sentance and ends in an EOL "A Requirement Sentance is string of characters that contains "shall" and ends with the period '.' character but contains no other periods." In RegExp terms this means
So, here we go. Maybe someone can improve it, especially stripping the leading spaces and making sure EOLs are handled
-Louie |
Re: Sentence in Object Text llandale - Mon Sep 22 15:31:27 EDT 2014 You should be able to use Regular Expressions. I'm going to scribble something up but not try it. The problem is defining "Requirement Sentance". If your requirement statement is always the 1st sentance and ends in an EOL "A Requirement Sentance is string of characters that contains "shall" and ends with the period '.' character but contains no other periods." In RegExp terms this means
So, here we go. Maybe someone can improve it, especially stripping the leading spaces and making sure EOLs are handled
-Louie Hi Louie, Many, many thanks for your detailed answer and the sample DXL code. Your sample code worked very well without needing any changes. Your regular expression is very useful and extracted sentences that have shall word, The GetShallRequirement(string sParagraph) function worked well without any changes. Thanks you so much for quick response. Later, I will explore implementing the changes to the regular expression as per your suggestions. Best regards, Mike
|
Re: Sentence in Object Text MikeMelon - Mon Sep 22 22:27:55 EDT 2014 Hi Louie, Many, many thanks for your detailed answer and the sample DXL code. Your sample code worked very well without needing any changes. Your regular expression is very useful and extracted sentences that have shall word, The GetShallRequirement(string sParagraph) function worked well without any changes. Thanks you so much for quick response. Later, I will explore implementing the changes to the regular expression as per your suggestions. Best regards, Mike
You are going to run into nuance problems; keep track of them and will fix it. |
Re: Sentence in Object Text llandale - Mon Sep 22 15:31:27 EDT 2014 You should be able to use Regular Expressions. I'm going to scribble something up but not try it. The problem is defining "Requirement Sentance". If your requirement statement is always the 1st sentance and ends in an EOL "A Requirement Sentance is string of characters that contains "shall" and ends with the period '.' character but contains no other periods." In RegExp terms this means
So, here we go. Maybe someone can improve it, especially stripping the leading spaces and making sure EOLs are handled
-Louie It is wounderful Louie, I did not understand the question and you gave the correct answer in the first shoot. |
Re: Sentence in Object Text Wolfgang Uhr - Wed Sep 24 04:06:31 EDT 2014 It is wounderful Louie, I did not understand the question and you gave the correct answer in the first shoot. I had this exact problem some years ago and failed. So I recognized it. I was trying to hard-code the solution and recall numerous nuances that complicated it a lot; shallow and marshall coming to mind. Only took me 4 years to become RegExp literate. Even so, I still must go back to the manual and my library examples in order to talk about it. -Louie |